Skip to content

Allow HermesJSRuntime/HermesRuntimeTargetDelegate to take both jsi::Runtime and HermesRuntime arguments in ctor#55732

Closed
lavenzg wants to merge 1 commit intofacebook:mainfrom
lavenzg:export-D94258352
Closed

Allow HermesJSRuntime/HermesRuntimeTargetDelegate to take both jsi::Runtime and HermesRuntime arguments in ctor#55732
lavenzg wants to merge 1 commit intofacebook:mainfrom
lavenzg:export-D94258352

Conversation

@lavenzg
Copy link
Copy Markdown
Contributor

@lavenzg lavenzg commented Feb 24, 2026

Summary:
Ideally we only need to pass jsi::Runtime, from which we can cast to
IHermes for Hermes specific interface methods. But in some scenarios
like instrumenting the runtime or tracing JSI calls, the passed runtime
would be a decorator of the actual HermesRuntime, we can't do casting
on the decoration type since it doesn't implement IHermes. So this diff
changes it to pass both a shared_ptr of jsi::Runtime and HermesRuntime
reference. It has no behavioral change.

Changelog: [Internal]

Differential Revision: D94258352

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 24, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Feb 24, 2026

@lavenzg has exported this pull request. If you are a Meta employee, you can view the originating Diff in D94258352.

lavenzg added a commit to lavenzg/react-native that referenced this pull request Feb 25, 2026
…untime and HermesRuntime arguments in ctor (facebook#55732)

Summary:

Ideally we only need to pass jsi::Runtime, from which we can cast to
IHermes for Hermes specific interface methods. But in some scenarios
like instrumenting the runtime or tracing JSI calls, the passed runtime
would be a decorator of the actual HermesRuntime, we can't do casting
on the decoration type since it doesn't implement IHermes. So this diff
changes it to pass both a shared_ptr of jsi::Runtime and HermesRuntime
reference. It has no behavioral change.

Changelog: [Internal]

Differential Revision: D94258352
…untime and HermesRuntime arguments in ctor (facebook#55732)

Summary:

Ideally we only need to pass jsi::Runtime, from which we can cast to
IHermes for Hermes specific interface methods. But in some scenarios
like instrumenting the runtime or tracing JSI calls, the passed runtime
would be a decorator of the actual HermesRuntime, we can't do casting
on the decoration type since it doesn't implement IHermes. So this diff
changes it to pass both a shared_ptr of jsi::Runtime and HermesRuntime
reference. It has no behavioral change.

Changelog: [Internal]

Differential Revision: D94258352
@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @lavenzg in 4f7fa58

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Feb 26, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Feb 26, 2026

This pull request has been merged in 4f7fa58.

zoontek pushed a commit to zoontek/react-native that referenced this pull request Mar 9, 2026
…untime and HermesRuntime arguments in ctor (facebook#55732)

Summary:
Pull Request resolved: facebook#55732

Ideally we only need to pass jsi::Runtime, from which we can cast to
IHermes for Hermes specific interface methods. But in some scenarios
like instrumenting the runtime or tracing JSI calls, the passed runtime
would be a decorator of the actual HermesRuntime, we can't do casting
on the decoration type since it doesn't implement IHermes. So this diff
changes it to pass both a shared_ptr of jsi::Runtime and HermesRuntime
reference. It has no behavioral change.

Changelog: [Internal]

Reviewed By: OmarBafagih

Differential Revision: D94258352

fbshipit-source-id: c09f305a8dfe76b723ed3cb2f0d52d3b61ae4893
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants